﻿using System.Linq;
using Entities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace EntityFramework
{
	[TestClass]
	public class LynnChangesJobs
	{
		[TestMethod]
		public void TestNewEmployee()
		{
			DatabaseSetup.Setup();
			Change();
		}


		private void Change()
		{
			using (var db = new EntityFrameworkDemoEntities())
			{
				//db.ContextOptions.LazyLoadingEnabled = true;
				var lynn = (from e in db.Employees.Include("Company1")
				            where e.Name == "lynn"
				            select e).First();
//				lynn.Company1.Website = "www.microsoft.com";
	//			var name = "Robert')Drop Table employee;--";
//				lynn.Employee2 = new Employee(){Name="Steve",Company1 = lynn.Company1};
//				lynn.Jobs.First().Status = "old";
//				lynn.Jobs.Add(new Job(){Title = "Goddess of the Earth",Employee1 = lynn});
//				db.DeleteObject(lynn.Events.First());
//				lynn.Events.Add(new Event(){EventTitle = "Wild Party with Drinks",Employee1 = lynn});
			}
		}
	}
}